// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios';
import VueAxios from 'vue-axios';
import './config/rem'
import FastClick from 'fastclick' // 引入FastClick
import { Popup, Toast } from 'vant';
Vue.use(Popup).use(Toast);
Vue.use(VueAxios, axios)

// 使用 fastclick
// FastClick.attach(document.body); 

// 提示框
Vue.prototype.$tip = msg => Toast({
  message: msg,
  forbidClick: true,
  duration: 1500
});
// 加载提示
Vue.prototype.$loading = msg => Toast.loading({
  message: msg ? msg : '请稍后...',
  forbidClick: true,
  duration: 0
});

router.beforeEach((to, from, next) => {
  next();
})

Vue.config.productionTip = false;;

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
